home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
codecs
/
developer
/
doc
/
codecs.doc
Wrap
Text File
|
1999-09-16
|
6KB
|
194 lines
TABLE OF CONTENTS
codecs.library/--general--
codecs.library/NewCodec
codecs.library/DisposeCodec
codecs.library/Encode
codecs.library/Decode
codecs.library/--tags--
codecs.library/--general-- codecs.library/--general--
codecs.library is designed to manage implementations of various compression
codecs and to provide a uniform interface to all these codecs.
The functions in the codecs.library create and destroy codec objects and
provide a common interface for all codecs.
A codec class is in fact a BOOPSI class stored in a shared library file.
The codecs.library opens this file for you when a codec object is created.
Instead of using the intuition DoMethod() function to invode the object's
methods, the codecs.library provides an Encode() and Decode() function to
handle the compression.
codecs.library/NewCodec codecs.library/NewCodec
NAME
NewCodec - Create a new codec object
SYNOPSIS
Codec = NewCodec(CodecName, Version)
D0 A0 D0
Codec *NewCodec(char *, ULONG)
FUNCTION
This is the general method of creating codec objects from 'codec'
classes.
INPUT
CodecName - The name of the codec class to create an instance of,
for example "byterun.codec" creates a codec object of
class byterun.codec.
Version - Minimum version of the codec class.
RESULT
Codec - Pointer to created codec object or 0 when an error
occured.
SEE ALSO
DisposeCodec()
codecs.library/DisposeCodec codecs.library/DisposeCodec
NAME
DisposeCodec - Dispose a codec object
SYNOPSIS
DisposeCodec(Codec)
A0
DisposeCodec(Codec *)
FUNCTION
Dispose a codec object
INPUT
Codec - Pointer to a previously created codec object
SEE ALSO
NewCodec()
codecs.library/Encode codecs.library/Encode
NAME
Encode - Encode a source using the codec object
SYNOPSIS
Result = Encode(Codec, TagItems)
D0 A0 A1
LONG Encode(Codec *, struct TagItem *)
FUNCTION
Dispose a codec object
INPUT
Codec - Pointer to a previously created codec object
TagItems - Array of TagItem structures, terminated by the value
TAG_END. This must contain a source and destination tag.
RESULT
Result - The number of bytes written to the destination or an error
value. Error values are always negative.
SEE ALSO
Decode()
codecs.library/Decode codecs.library/Decode
NAME
Decode - Decode a source using the codec
SYNOPSIS
Result = Decode(Codec, TagItems)
D0 A0 A1
LONG Decode(Codec *, struct TagItem *)
FUNCTION
Decode the source to destination using the specified codec object.
The source must be a memory
INPUT
Codec - Pointer to a previously created codec object
TagItems - Array of TagItem structures, terminated by the value
TAG_END. This must contain a source and destination tag.
RESULT
Result - The number of bytes used from the source the decode the
picture from or an error value. Error values are always
negative.
SEE ALSO
Encode()
codecs.library/--tags-- codecs.library/--tags--
THE TAGS FOR Encode() AND Decode()
GENERAL
SOURCE TAGS
CA_DST_HANDLE
This tag specifies the destination for the encoded or decoded data.
The type of the handle determines whether additional attributes for
the destination handle.
CA_DST_TYPE
This tag specifies the type of destination handle. Depending on the
type additional tags are:
- TYPE_MEMORY Destination is a buffer in memory.
- TYPE_BITMAP Destination is a standard BitMap structure as defined
in gfx.h.
CA_DST_SIZE
This tag specifies the size of the destination buffer when the
destination is of type TYPE_MEMORY.
DESTINATION TAGS
CA_SRC_HANDLE
This tag specifies the source for the encoded or decoded data. The
type of the handle determines whether additional attributes for
the source handle.
CA_SRC_TYPE
This tag specifies the type of source handle. Depending on the
type additional tags are:
- TYPE_MEMORY Source is a buffer in memory.
- TYPE_BITMAP Source is a standard BitMap structure as defined
in gfx.h.
CA_SRC_SIZE
This tag specifies the size of the source buffer when the source
is of type TYPE_MEMORY.
IMAGE TAGS
CA_IMAGEWIDTH
CA_IMAGEHEIGHT
CA_IMAGEDEPTH
These tags specify the width of height and depth of an image when one
of source destination handles is of type TYPE_BITMAP. Default these
values are taken from the BitMap structure itself, but you may set
them yourself with these tags. Especially the image width because
that is inaccurate because it is taken from BytesPerRow which may
indicate a larger value than you image really has.
TODO
More tags will be defined when there are codecs that:
- decode images progressively
- perform lossy coding for images
- code animations
- offer a choice for different entropy coders
- etc..